<template>
	<view>
		<view class="padding30rpx">
			<view class="login-top">
				<image src="../../static/login/logo.png"></image>
			</view>
		</view>
		<view class="margin-top25rpx greet">
			<view>亲爱的，{{name||''}}您好！ </view>
		</view>
		<view class="margin-top25rpx" style="text-align: center;">
			<image src="../../static/login/ling.png" class="greet_img"></image>
		</view>
		<view class="hui99" style="text-align: center;width: 60%;margin: 0 auto;">
			IBMG零商e学为您提供最适合中国本土连锁零售企业核心岗位系统学习平台，祝您学习愉快，学有所成!
		</view>
		<view class="padding30rpx">
			<button @click="gang">选择我的岗位</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: ""
			}
		},
		onLoad(option) {
			this.name = option.name
		},
		methods: {
			gang() {
				var self = this
				uni.request({
					method: 'GET',
					url: self.$api + '/app/UserController/addUserPost',
					header: {
						'token': uni.getStorageSync('token')
					},
					success: (resp) => {
						console.log(resp.data, '查当前token是否已选择岗位')
						if (resp.data.code == 200) {
							if (resp.data.data.yesno == false) {
								uni.navigateTo({
									url: '../study/choice/choice'
								})
							} else {
								uni.switchTab({
									url: '../term/term'
								})
							}
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	button {
		background: #00A29A;
		color: #FFFFFF;
		// font-size: 32rpx;
		margin-top: 40rpx;
	}

	.login-top {
		text-align: center;
		margin: 30rpx 0;

		image {
			width: 249rpx;
			height: 124rpx;

		}
	}

	.greet_img {
		width: 430rpx;
		height: 375rpx;
		margin-bottom: 60rpx;
		margin-top: 60rpx;
	}

	.greet {
		font-size: 40rpx;
		font-weight: bold;
		text-align: center;
	}
</style>
